package com.example.sfm.pojo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;

@Data
@Accessors(chain = true)
@Schema(description = "成绩传输对象",name = "GradesDto")
public class GradesDto {
    @Schema(description = "学生ID", deprecated = true )
    @NotNull(message = "学生ID不能为空")
    private Integer studentId;

    @Schema(description = "课程ID", deprecated = true)
    @NotNull(message = "课程ID不能为空")
    private Integer courseId;

    @Schema(description = "成绩（0.00-100.00）", deprecated = true)
    @DecimalMin(value = "0.00", message = "成绩不能小于0")
    @DecimalMax(value = "100.00", message = "成绩不能超过100")
    private BigDecimal score;

    @Schema(description = "成绩等级（0-3）", deprecated = true)
    @Min(value = 0, message = "等级范围0-3")
    @Max(value = 3, message = "等级范围0-3")
    private Integer grade;

    @Schema(description = "考试日期（格式：yyyy-MM-dd）")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate examDate;

    @Schema(description = "成绩备注")
    private String remark;
}
